/**
 * Author: Dmitry Ustimov
 * Date: 5/22/13
 * Time: 2:01 PM
 */

package com.gmail.dmitryustimov.ms.java7.visitor.classic.work.demo.structure1_16_4096_1048576;

public class ElementRoot extends Element {

    public ElementRoot() {
        for (int i = 0; i < 16; i++) {
            this.elements.add(new ElementA());
        }
    }

    public void accept(ElementVisitor visitor) {
        visitor.visit(this);
        for(Element elem : elements) {
            elem.accept(visitor);
        }
    }
}
